/**
 * Created by wangzilong on 2017/4/11.
 */
import React, { Component } from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    Image,
    ScrollView,
    TouchableOpacity,
    TextInput,
    ListView,
    Platform
} from 'react-native';
import Swiper from 'react-native-swiper';
import ImageWrapper from '../components/ImageWrapper';
import NavigationBar from '../components/NavigationBar';
var Dimensions = require('Dimensions');
const { width, height } = Dimensions.get('window');

export default class GoodsDetails extends Component{
    constructor(props) {
        super(props);
        this.state = {
            
        };
    }
    render(){
        return (
            <View style={styles.container}>
                <NavigationBar leftIcon={'left'} titleText={'商品详情'} leftPress={()=>this.goBack()}/>
                <ScrollView>
                    <Swiper autoplay={true}  autoplayTimeout={5} showsButtons={false} width={width} height={300*width/600}>
                        <View style={{flex:1,justifyContent:'center',alignItems:'center'}}>
                            <ImageWrapper width={width} height={300*width/600} icon={'banner1'}/>
                        </View>
                        <View style={{flex:1,justifyContent:'center',alignItems:'center'}}>
                            <ImageWrapper width={width} height={300*width/600} icon={'banner2'}/>
                        </View>
                        <View style={{flex:1,justifyContent:'center',alignItems:'center'}}>
                            <ImageWrapper width={width} height={300*width/600} icon={'banner3'}/>
                        </View>
                    </Swiper>
                    <View style={styles.textBox}>
                        <View style={styles.lineItem}>
                            <Text style={{color:'#333',fontSize:14}}>狗狗牵引绳，金毛专用，专用狗狗用品6666666</Text>
                        </View>
                        <View style={styles.lineItem}>
                            <Text style={{fontSize:16,color:'#FF0000'}}>今日特价:￥18.8</Text>
                        </View>
                        <View style={styles.lineItem}>
                            <Text style={{fontSize:16,color:'#333',textDecorationLine:'line-through'}}>原价:￥80</Text>
                        </View>
                    </View>
                </ScrollView>
            </View>
        )

    }

    goBack(){
        this.props.navigation.goBack();
    }


}



const styles = StyleSheet.create({
    container:{
        flex:1,
        backgroundColor:'#EFEFF4',
        ...Platform.select({
            ios: {
                marginTop: 20
            },
            android: {
                marginTop:0
            },

        }),
    },
    textBox:{
        backgroundColor:'#fff',
        padding:20
    },
    lineItem:{
        paddingTop:3,
        paddingBottom:3,
    }
    
});